const index = {
	data() {
		return {
			pageHeight: ""
		}
	},
	computed: {

	},
	beforeMount() {
		this.pageHeight = uni.getSystemInfoSync().safeArea.height + uni.getSystemInfoSync().safeAreaInsets.top + uni
			.getSystemInfoSync().safeAreaInsets.bottom
	},
	mounted() {

	},
	methods: {
		//复制
		copy(str) {
			uni.setClipboardData({
				data: str,
				success: function() {
					uni.showToast({
						icon: "none",
						title: '复制成功！',
						duration: 2000
					});
				}
			})
		},
		//返回上几页
		returnPage(pageNumner, animationType = 'slide-out-right', query) {
			console.log("BACK =>", query)
			getApp().globalData.query = query
			uni.navigateBack({
				delta: pageNumner,
				animationType: animationType
			});
		},
		//跳转页面
		go(route, animationType = 'fade-in', query) {
			let token = uni.getStorageSync('token')
			if (token.length === 0) {
				this.go('/pages/login/login')
			}
			console.log("GO =>", route)
			getApp().globalData.query = query
			uni.navigateTo({
				animationType: animationType,
				url: route
			});
		},
		//关闭现在的页面，跳转页面
		jump(route, query) {
			console.log("JUMP =>", route)
			getApp().globalData.query = query
			uni.reLaunch({
				url: route
			});
		},
		rArray(key) {
			this[key].push(0)
			this[key].splice(this[key].length - 1, 1)
		}
	}
}

export default index
